package com.ruoyi.sgsc.service.impl;

import java.util.List;

import com.ruoyi.sgsc.domain.orderdetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sgsc.mapper.ordersMapper;
import com.ruoyi.sgsc.domain.orders;
import com.ruoyi.sgsc.service.IordersService;

/**
 * 订单Service业务层处理
 * 
 * @author wy
 * @date 2024-09-29
 */
@Service
public class ordersServiceImpl implements IordersService 
{
    @Autowired
    private ordersMapper ordersMapper;

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public orders selectordersByOrderId(Long orderId)
    {
        return ordersMapper.selectordersByOrderId(orderId);
    }

    /**
     * 查询订单列表
     * 
     * @param orders 订单
     * @return 订单
     */
    @Override
    public List<orders> selectordersList(orders orders)
    {
        return ordersMapper.selectordersList(orders);
    }

    /**
     * 获取最新一条订单id
     * @return
     */
    public orders selectordersByDate()
    {
        return ordersMapper.selectordersByDate();
    }


    /**
     * 新增订单
     * 
     * @param orders 订单
     * @return 结果
     */
    @Override
    public int insertorders(orders orders)
    {
        return ordersMapper.insertorders(orders);
    }

    /**
     * 修改订单
     * 
     * @param orders 订单
     * @return 结果
     */
    @Override
    public int updateorders(orders orders)
    {
        return ordersMapper.updateorders(orders);
    }

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteordersByOrderIds(Long[] orderIds)
    {
        return ordersMapper.deleteordersByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deleteordersByOrderId(Long orderId)
    {
        return ordersMapper.deleteordersByOrderId(orderId);
    }
}
